package cn.getech.data.development.service.impl;

import cn.getech.data.development.entity.JobRunUdf;
import cn.getech.data.development.mapper.JobRunUdfMapper;
import cn.getech.data.development.model.dto.JobRunUdfDto;
import cn.getech.data.development.service.JobRunUdfService;
import cn.getech.data.intelligence.common.utils.PojoUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author HQZ
 * @since 2019-12-12
 */
@Service
public class JobRunUdfServiceImpl extends ServiceImpl<JobRunUdfMapper, JobRunUdf> implements JobRunUdfService {

    @Override
    public List<JobRunUdfDto> listUdfFuncs() {
        List<JobRunUdf> jobRunUdfs = baseMapper.selectList(new QueryWrapper<JobRunUdf>().eq("is_usable", 1).orderByDesc("create_time"));
        return PojoUtils.listConvert(JobRunUdfDto.class,jobRunUdfs);
    }
}
